#include <fstream>
#include <iostream>
#include <iterator>
#include <string>

class Line : public std::string {};

std::istream &operator>>(std::istream &is, Line &l) {
  std::getline(is, l);

  return is;
}

class FileReader {
public:
  using iterator = std::istream_iterator<Line>;
  inline iterator begin() noexcept { return begin_; }

  inline iterator end() noexcept { return end_; }

public:
  FileReader(const std::string path) : f_{path}, begin_{f_} {}
  friend std::istream &operator>>(std::istream &, std::string &);

private:
  std::ifstream f_;
  iterator begin_;
  iterator end_;
};

int main(int argc, char *argv[]) {
  FileReader reader(argv[1]);
  for (const auto &line : reader) {
    std::cout << line << "\n";
  }
  return 0;
}
